]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
status/keyboard: Check if this._currentSource is valid on activation
authorRui Matos <tiagomatos@gmail.com>
Thu, 14 Mar 2013 12:25:12 +0000 (13:25 +0100)
committerRui Matos <tiagomatos@gmail.com>
Thu, 14 Mar 2013 13:56:28 +0000 (14:56 +0100)
this._currentSource might be invalid so check for that to prevent an
exception and still switch to the newly activated source.

https://bugzilla.gnome.org/show_bug.cgi?id=695841

js/ui/status/keyboard.js

index 4e629b107ee22444e4907918861fab32e88f63c2..3dc173b99a4354ffa19e69727a680e05975ec34c 100644 (file)
@@ -487,7 +487,7 @@ const InputSourceIndicator = new Lang.Class({
             let is = new InputSource(type, id, displayName, shortName, i);
 
             is.connect('activate', Lang.bind(this, function() {
-                if (this._currentSource.index == is.index)
+                if (this._currentSource && this._currentSource.index == is.index)
                     return;
                 this._settings.set_value(KEY_CURRENT_INPUT_SOURCE,
                                          GLib.Variant.new_uint32(is.index));